home *** CD-ROM | disk | FTP | other *** search
/ Spanish Scene 1 / SpanishScene1.iso / spanish pack n°1 by llfb / --llfb-- / programas / sources1.dms / sources1.adf / SOURCES / Efectos_Copper / SinusCop.ASM < prev   
Assembly Source File  |  1996-06-04  |  8KB  |  301 lines

  1. ; I+ Copper by T.J.
  2.  
  3. ; Thanks to DELTA of RSI for his amazing copper-intro! This
  4. ; program is original code.... no rip off!!!
  5.  
  6. ; [1] change to double buffering of copperlist
  7. ; [2] scroll text
  8. ; [3] lots of effects and a moving logo (?)
  9.  
  10. width=41
  11. s=width*4+4
  12. amplitude=80
  13.  
  14.         section    roman,code_c
  15.  
  16. start:        move.l    4,a6
  17.         move.w    #$4000,$dff09a
  18.         move.w    #$7fff,$dff096
  19.         bsr.L    clr_sprites
  20.         bsr.L    set_bitplanes
  21.         bsr.L    make_sin_tab
  22.         move.l    #copper,$dff080
  23.         clr.w    $dff088
  24.         move.w    #$83ff,$dff096
  25.  
  26.         move.w    #$3141,d0
  27.         lea    copsinus,a0
  28.         move.w    #199,d1
  29. l1:        move.w    d0,(a0)
  30.         move.w    #$fffe,2(a0)
  31.         move.l    #$01800000,width*4-4(a0)
  32.         adda    #width*4,a0
  33.         add.w    #$0100,d0
  34.         dbra    d1,l1
  35.  
  36. main_loop:    cmp.b    #255,$dff006
  37.         bne.s    main_loop
  38.  
  39.         move.l    #copsinus,$dff050
  40.         move.l    #copsinu1,$dff054
  41.         move.l    #0,$dff064
  42.         move.l    #$09f00000,$dff040
  43.         move.l    #-1,$dff044
  44.         move.w    #64*400+41,$dff058
  45.         bsr.L    wait_blit
  46.  
  47.         addq.w    #6,sinuspn1
  48.         andi.w    #510,sinuspn1
  49.         addq.w    #8,sinuspn2
  50.         andi.w    #510,sinuspn2
  51.         lea    sincos,a4
  52.  
  53.         move.w    sinuspn1,d7
  54.         move.w    #width-3,d2
  55.         lea    copsinus+4,a0
  56.         lea    coptbl,a1
  57. l3:        move.l    a0,a2
  58.         move.l    a1,a3
  59.         move.w    (a4,d7.w),d1
  60.         muls    #amplitude,d1
  61.         lsl.l    #1,d1
  62.         swap    d1
  63.         addi.w    #amplitude,d1
  64.         lsl    #2,d1
  65.         adda.w    d1,a3
  66.         move.l    a3,$dff050
  67.         move.l    a2,$dff054
  68.         move.w    #width*8-4,$dff066
  69.         move.w    #99*64+2,$dff058
  70.         bsr.L    wait_blit
  71.         addq    #2,d7
  72.         andi.w    #510,d7
  73.         addq    #4,a0
  74.         dbra    d2,l3
  75.  
  76.         move.w    sinuspn2,d7
  77.         move.w    #width-3,d2
  78.         lea    copsinus+s,a0
  79. l2:        move.l    a0,a2
  80.         move.l    a1,a3
  81.         move.w    (a4,d7.w),d1
  82.         muls    #amplitude,d1
  83.         lsl.l    #1,d1
  84.         swap    d1
  85.         addi.w    #amplitude,d1
  86.         lsl    #2,d1
  87.         adda.w    d1,a3
  88.         move.l    a3,$dff050
  89.         move.l    a2,$dff054
  90.         move.w    #99*64+2,$dff058
  91.         bsr.S    wait_blit
  92.         addq    #2,d7
  93.         andi.w    #510,d7
  94.         addq    #4,a0
  95.         dbra    d2,l2
  96.  
  97. chk_mouse:    btst    #6,$bfe001
  98.         bne.L    main_loop
  99.  
  100. end:        bsr.S    wait_blit
  101.         move.l    4,a6
  102.         move.l    #grname,a1
  103.         clr.l    d0
  104.         jsr    -552(a6)
  105.         move.l    d0,a4
  106.         move.l    38(a4),$dff080
  107.         clr.w    $dff088
  108.         move.w    #$83e0,$dff096
  109.         move.w    #$c000,$dff09a
  110.         clr.l    d0
  111.         rts
  112.  
  113. wait_blit:    btst    #14,$dff002
  114.         bne.s    wait_blit
  115.         rts
  116.  
  117. set_bitplanes:    move.l    #scr_buffer,d0
  118.         lea    bpls,a0
  119.         moveq    #3,d1
  120. set_bpl_pnt:    move.w    d0,6(a0)
  121.         swap    d0
  122.         move.w    d0,2(a0)
  123.         swap    d0
  124.         add    #40,d0
  125.         addq    #8,a0
  126.         dbra    d1,set_bpl_pnt
  127.         rts
  128.  
  129. clr_sprites:    lea    copspr,a0
  130.         move.l    #$0120,d0
  131.         move.l    #7,d1
  132. cl_spr_pnt:    move.w    d0,(a0)+
  133.         clr.w    (a0)+
  134.         add.w    #2,d0
  135.         move.w    d0,(a0)+
  136.         clr.w    (a0)+
  137.         add.w    #2,d0
  138.         dbra    d1,cl_spr_pnt
  139.         rts
  140.  
  141. make_sin_tab:    lea    sincos+128,a0
  142.         lea    sincos+128,a1
  143.         lea    sincos+640,a2
  144.         move.w    #63,d0
  145. msl00:        move.w    -(a0),(a1)+
  146.         move.w    (a0),-(a2)
  147.         dbra    d0,msl00
  148.         move.w    #127,d0
  149. msl01:        move.w    (a0)+,d1
  150.         neg.w    d1
  151.         move.w    d1,(a1)+
  152.         dbra    d0,msl01
  153.         rts        
  154.  
  155. grname:        dc.b    "graphics.library",0,0
  156.  
  157. copper:        dc.w    $008e,$3081,$0090,$08c1
  158.         dc.w    $0092,$0038,$0094,$00d0
  159.         dc.w    $0102,$0000,$0104,$0000
  160.         dc.w    $0108,$0000,$010a,$0000
  161.         dc.w    $0100,$1200
  162.         dc.w    $0180,$0000,$0182,$0000
  163. copspr:        blk.b    64,0
  164. bpls:        dc.w    $00e0,$0000,$00e2,$0000
  165.         dc.w    $00e4,$0000,$00e6,$0000
  166.         dc.w    $00e8,$0000,$00ea,$0000
  167.         dc.w    $00ec,$0000,$00ee,$0000    
  168. copsinu1:    blk.b    4*width*200,0
  169.         dc.w    $ffff,$fffe
  170. copsinus:    blk.b    4*width*200,0
  171.  
  172.  
  173. coptbl:
  174.     dc.w    $0180,$0ce0,$0180,$0ce0,$0180,$0cd0,$0180,$0cd0
  175.     dc.w    $0180,$0dd0,$0180,$0cc0,$0180,$0cb0,$0180,$0ba0
  176.     dc.w    $0180,$0ba0,$0180,$0b90,$0180,$0a80,$0180,$0a70
  177.     dc.w    $0180,$0a70,$0180,$0960,$0180,$0960,$0180,$0850
  178.     dc.w    $0180,$0840,$0180,$0840,$0180,$0740,$0180,$0730
  179.     dc.w    $0180,$0630,$0180,$0620,$0180,$0620,$0180,$0520
  180.     dc.w    $0180,$0510,$0180,$0410,$0180,$0410,$0180,$0400
  181.     dc.w    $0180,$0300,$0180,$0300,$0180,$0200,$0180,$0200
  182.  
  183.  
  184.     dc.w    $0180,$0200,$0180,$0200,$0180,$0200,$0180,$0300
  185.     dc.w    $0180,$0310,$0180,$0310,$0180,$0310,$0180,$0420
  186.     dc.w    $0180,$0420,$0180,$0430,$0180,$0440,$0180,$0540
  187.     dc.w    $0180,$0550,$0180,$0550,$0180,$0550,$0180,$0460
  188.     dc.w    $0180,$0460,$0180,$0460,$0180,$0370,$0180,$0370
  189.     dc.w    $0180,$0270,$0180,$0170,$0180,$0180,$0180,$0080
  190.     dc.w    $0180,$0080,$0180,$0081,$0180,$0092,$0180,$0093
  191.     dc.w    $0180,$0094,$0180,$0095,$0180,$00a6,$0180,$00a7
  192.  
  193.  
  194.     dc.w    $0180,$00a7,$0180,$00a7,$0180,$00a8,$0180,$00a8
  195.     dc.w    $0180,$00a9,$0180,$00aa,$0180,$009a,$0180,$008a
  196.     dc.w    $0180,$008a,$0180,$007a,$0180,$006a,$0180,$005a
  197.     dc.w    $0180,$005a,$0180,$004a,$0180,$003a,$0180,$002a
  198.     dc.w    $0180,$002a,$0180,$001a,$0180,$000a,$0180,$010a
  199.     dc.w    $0180,$010a,$0180,$020a,$0180,$030a,$0180,$040a
  200.     dc.w    $0180,$040a,$0180,$050a,$0180,$060a,$0180,$070a
  201.     dc.w    $0180,$080a,$0180,$080a,$0180,$090a,$0180,$0a0a
  202.  
  203.  
  204.  
  205.     dc.w    $0180,$0a0a,$0180,$0a0a,$0180,$0a0a,$0180,$0a09
  206.     dc.w    $0180,$0909,$0180,$0908,$0180,$0908,$0180,$0907
  207.     dc.w    $0180,$0907,$0180,$0907,$0180,$0906,$0180,$0906
  208.     dc.w    $0180,$0805,$0180,$0805,$0180,$0805,$0180,$0804
  209.     dc.w    $0180,$0804,$0180,$0804,$0180,$0803,$0180,$0803
  210.     dc.w    $0180,$0703,$0180,$0702,$0180,$0702,$0180,$0702
  211.     dc.w    $0180,$0702,$0180,$0701,$0180,$0701,$0180,$0701
  212.     dc.w    $0180,$0601,$0180,$0600,$0180,$0600,$0180,$0600
  213.  
  214.  
  215.     dc.w    $0180,$0600,$0180,$0600,$0180,$0600,$0180,$0710
  216.     dc.w    $0180,$0710,$0180,$0720,$0180,$0820,$0180,$0830
  217.     dc.w    $0180,$0830,$0180,$0840,$0180,$0951,$0180,$0961
  218.     dc.w    $0180,$0961,$0180,$0a71,$0180,$0a81,$0180,$0a81
  219.     dc.w    $0180,$0a91,$0180,$0ba1,$0180,$0bb1,$0180,$0bb1
  220.     dc.w    $0180,$0bc1,$0180,$0ac2,$0180,$0ac2,$0180,$0ad2
  221.     dc.w    $0180,$09d2,$0180,$09d2,$0180,$08d2,$0180,$08e2
  222.     dc.w    $0180,$08e3,$0180,$07e3,$0180,$07f3,$0180,$06f3
  223.  
  224.  
  225.     dc.w    $0180,$06f3,$0180,$06f3,$0180,$06f3,$0180,$05e3
  226.     dc.w    $0180,$05e3,$0180,$05e3,$0180,$04e3,$0180,$04e3
  227.     dc.w    $0180,$04d2,$0180,$03d2,$0180,$03d2,$0180,$03d2
  228.     dc.w    $0180,$02c2,$0180,$02c2,$0180,$02c2,$0180,$02c3
  229.     dc.w    $0180,$02b3,$0180,$02b3,$0180,$02b3,$0180,$02b3
  230.     dc.w    $0180,$02a3,$0180,$02a3,$0180,$02a3,$0180,$01a3
  231.     dc.w    $0180,$01a3,$0180,$0180,$0180,$0180,$0180,$0180
  232.     dc.w    $0180,$0180,$0180,$0180,$0180,$0180,$0180,$0180
  233.  
  234.  
  235.     dc.w    $0180,$0180,$0180,$0180,$0180,$0185,$0180,$0185
  236.     dc.w    $0180,$0180,$0180,$0187,$0180,$0187,$0180,$0180
  237.     dc.w    $0180,$0178,$0180,$0168,$0180,$0158,$0180,$0158
  238.     dc.w    $0180,$0148,$0180,$0138,$0180,$0138,$0180,$0128
  239.     dc.w    $0180,$0118,$0180,$0218,$0180,$0218,$0180,$0318
  240.     dc.w    $0180,$0418,$0180,$0418,$0180,$0518,$0180,$0618
  241.     dc.w    $0180,$0718,$0180,$0718,$0180,$0818,$0180,$0817
  242.     dc.w    $0180,$0816,$0180,$0816,$0180,$0815,$0180,$0814
  243.  
  244.     dc.w    $0180,$0814,$0180,$0180,$0180,$0180,$0180,$0183
  245.     dc.w    $0180,$0183,$0180,$0180,$0180,$0180,$0180,$0181
  246.     dc.w    $0180,$0181,$0180,$0181,$0180,$0281,$0180,$0281
  247.     dc.w    $0180,$0381,$0180,$0381,$0180,$0381,$0180,$0481
  248.     dc.w    $0180,$0481,$0180,$0481,$0180,$0581,$0180,$0581
  249.     dc.w    $0180,$0681,$0180,$0681,$0180,$0681,$0180,$0781
  250.     dc.w    $0180,$0781,$0180,$0881,$0180,$0881,$0180,$0881
  251.     dc.w    $0180,$0871,$0180,$0871,$0180,$0861,$0180,$0861
  252.  
  253.  
  254.     dc.w    $0180,$0861,$0180,$0861,$0180,$0861,$0180,$0871
  255.     dc.w    $0180,$0881,$0180,$0982,$0180,$0992,$0180,$0992
  256.     dc.w    $0180,$0892,$0180,$0892,$0180,$0893,$0180,$08a3
  257.     dc.w    $0180,$08a3,$0180,$07a3,$0180,$07a3,$0180,$07a4
  258.     dc.w    $0180,$07a4,$0180,$07b4,$0180,$07b4,$0180,$06b5
  259.     dc.w    $0180,$06b5,$0180,$06b5,$0180,$06b5,$0180,$06c6
  260.     dc.w    $0180,$06c6,$0180,$06c7,$0180,$06c7,$0180,$07c8
  261.     dc.w    $0180,$07c8,$0180,$07d9,$0180,$08d9,$0180,$08da
  262.  
  263.     dc.w    $0180,$08da,$0180,$08da,$0180,$08d9,$0180,$07c9
  264.     dc.w    $0180,$07c9,$0180,$07b8,$0180,$07b8,$0180,$06b8
  265.     dc.w    $0180,$06a7,$0180,$06a7,$0180,$06a7,$0180,$0596
  266.     dc.w    $0180,$0596,$0180,$0596,$0180,$0585,$0180,$0485
  267.     dc.w    $0180,$0475,$0180,$0475,$0180,$0474,$0180,$0364
  268.     dc.w    $0180,$0364,$0180,$0363,$0180,$0353,$0180,$0353
  269.     dc.w    $0180,$0253,$0180,$0242,$0180,$0242,$0180,$0232
  270.     dc.w    $0180,$0232,$0180,$0131,$0180,$0121,$0180,$0121
  271.  
  272.  
  273.     dc.w    $0180,$0121,$0180,$0e09,$0180,$0e0a,$0180,$0e0c
  274.     dc.w    $0180,$0e0d,$0180,$0d0e,$0180,$0c0e,$0180,$0b0e
  275.     dc.w    $0180,$090e,$0180,$090e,$0180,$070e,$0180,$060e
  276.     dc.w    $0180,$050e,$0180,$030e,$0180,$020e,$0180,$010e
  277.     dc.w    $0180,$000e,$0180,$001e,$0180,$002e,$0180,$003e
  278.     dc.w    $0180,$004e,$0180,$005e,$0180,$005e,$0180,$006e
  279.     dc.w    $0180,$007e,$0180,$008f,$0180,$009f,$0180,$00af
  280.     dc.w    $0180,$00bf,$0180,$00cf,$0180,$00df,$0180,$00ef
  281.  
  282.  
  283. scr_buffer:    blk.b    8000,$55
  284.  
  285. sincos:        dc.w    00000,00804,01607,02410,03211,04011
  286.         dc.w    04808,05602,06392,07179,07961,08739
  287.         dc.w    09512,10278,11039,11793,12539,13278
  288.         dc.w    14010,14732,15446,16151,16846,17530
  289.         dc.w    18204,18868,19519,20159,20787,21403
  290.         dc.w    22005,22594,23170,23732,24279,24812
  291.         dc.w    25330,25832,26319,26790,27245,27684
  292.         dc.w    28106,28511,28898,29269,29621,29956
  293.         dc.w    30273,30572,30852,31114,31357,31581
  294.         dc.w    31785,31971,32138,32285,32413,32521
  295.         dc.w    32610,32679,32728,32758
  296.         blk.b    512,0
  297.  
  298. sinuspn1:    dc.w    0
  299. sinuspn2:    dc.w    0
  300.  
  301.